package com.douxg.fastCoding.db.clickhouse;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description
 * @Auther douxg
 * @Date 2020/11/12 11:32
 */
@Data
@Accessors(chain = true)
public class CkColumn {
    private String database;
    private String table;
    private String name;
    private String type;
    private String comment;
    private boolean nullable;

    public void setType(String type) {
        if (type.startsWith("Nullable")) {
            this.nullable = true;
            this.type = type.replace("Nullable(", "").replace(")", "");
        } else {
            this.type = type;
        }
    }
}
